package net.comm.group.db;


import java.sql.ResultSet;
import java.sql.SQLException;

import net.comm.group.bean.BaseGsignup;
import net.comm.user.bean.BaseUsers;
import net.comm.user.service.impl.UsersServiceImpl;
import net.comm.util.StringUtil;

import org.apache.log4j.Logger;
import org.sakaiproject.db.api.SqlReader;

public class DbGsignupService implements SqlReader
{
	static Logger logger = Logger.getLogger(DbGsignupService.class.getName());
	/**
	 * Read from the result one set of fields to create a Resource.
	 * 
	 * @param result
	 *        The Sql query result.
	 * @return The Resource object.
	 */
	public Object readSqlResultRecord(ResultSet result)
	{
		try
		{
			int  	partyID = result.getInt(1);									//	活动序号
			int  	userID = result.getInt(2);									//	报名用户ID
			String  signDate = StringUtil.getValue(result.getString(3));		//	报名日期

			// create the Resource from these fields
			return new BaseGsignup(  partyID,  userID,  signDate );
		}
		catch (SQLException e)
		{
			logger.error(e.getMessage());
			return null;
		}
		
	}
}
